package com.net.xpay.core.service.auto;

import com.net.xpay.common.domain.User;
import com.net.xpay.core.domain.PayTrans;
import com.net.xpay.core.domain.PayTransBatch;
import com.net.xpay.core.domain.auto.AutoPayBatch;
import com.net.xpay.core.model.CommonAutoPayModel;

import java.util.List;

/**
 *自動付
 * @author 86188
 */
public interface AutoPayService {

    AutoPayBatch ensureAutoPayBatch(User merchant, Long id);

    /**
     * 发起转账
     * @return
     */
    String autoPay(User user, CommonAutoPayModel payModel);

    /**
     * 跟新转账结果
     */
    void updatePayResult(User user, PayTransBatch batch, List<PayTrans> payTransList);

    /**
     * 主动关闭订单
     */
    void closeAutoPayTransBatch(User user, Long id);

    void closeAutoPayTransBatchCallback(User user, PayTransBatch payTransBatch);

}
